#pragma once


class BaseCommand
{
public:
	BaseCommand( const std::wstring& command );
	virtual ~BaseCommand();

	virtual void DisplayHelp() = 0;
	void dumpBuffer( const BYTE* pBuffer, size_t cbBuffer );
	virtual bool Execute( const std::map<std::wstring, std::wstring>& params ) = 0;
	std::wstring GetCommand();
	ACCESS_MASK GetAccessParameter( const std::map<std::wstring, std::wstring>& params, const std::wstring& name, const std::wstring& defaultValue );
	HANDLE GetHandleParameter( const std::map<std::wstring, std::wstring>& params, const std::wstring& name );
	HANDLE GetHandleParameter( const std::map<std::wstring, std::wstring>& params, const std::wstring& name, HANDLE defaultValue );
	std::wstring GetNamedParameter( const std::map<std::wstring, std::wstring>& params, const std::wstring& name );
	std::wstring GetNamedParameter( const std::map<std::wstring, std::wstring>& params, const std::wstring& name, const std::wstring& defaultValue );
	long GetNamedParameterInt( const std::map<std::wstring, std::wstring>& params, const std::wstring& name );
	long GetNamedParameterInt( const std::map<std::wstring, std::wstring>& params, const std::wstring& name, long defaultValue );

private:
	std::wstring m_command;
};

class QuitCommand : public BaseCommand
{
public:
	QuitCommand();
	virtual ~QuitCommand();
	virtual void DisplayHelp();
	virtual bool Execute( const std::map<std::wstring, std::wstring>& params );
};

class QueryObjectCommand : public BaseCommand
{
public:
	QueryObjectCommand();
	virtual ~QueryObjectCommand();
	virtual void DisplayHelp();
	virtual bool Execute( const std::map<std::wstring, std::wstring>& params );
};
